package cn.itcast.demo1;

import java.io.File;

import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.widget.ImageView;
import android.widget.ScrollView;

public class DemoActivity extends Activity {
	private ScrollView sv;
	
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        sv = (ScrollView) this.findViewById(R.id.sv);
    }
    
    public void add(View view){
    	ImageView iv = new ImageView(this);
    	File image = new File(Environment.getExternalStorageDirectory(),"img.JPG");
    	iv.setImageURI(Uri.fromFile(image));
    	sv.addView(iv);
    }
}